 CREATE EXTERNAL TABLE jms_dwd.dwd_s02_whole_operations_trace_step_dt(
   `waybill_no` string COMMENT '运单号',
   `step` int COMMENT '站点',
   `network_code` string COMMENT '站点编码',
   `network_type` string COMMENT '站点类型',
   `network_name` string COMMENT '站点名称',
   `step_all_operations_count` int COMMENT '站点总操作次数',
   `scan_time_lastest` timestamp COMMENT '站点最晚扫描时间',
   `scan_time_earlist` timestamp COMMENT '站点最早扫描时间',
   `scan_type_lastest` timestamp COMMENT '站点最晚扫描类型',
   `scan_type_earlist` timestamp COMMENT '站点最早扫描类型',
   `prev_network_code` string COMMENT '上一站网点编码',
   `prev_network_type` string COMMENT '上一站网点类型',
   `next_network_code` string COMMENT '下一站网点编码',
   `next_network_type` string COMMENT '下一站网点类型',
   `step_center` int COMMENT '中心正序',
   `step_center_reserve` int COMMENT '中心逆序',
   `step_entrepot` int COMMENT '集散正序',
   `step_entrepot_reserve` int COMMENT '集散逆序',
   `actual_taking_scantime` timestamp COMMENT '站点实际揽收时间(揽收入仓取最早)',
   `actual_taking_weight` double COMMENT '站点实际揽收重量(揽收入仓取最早)',
   `actual_taking_scantype` string COMMENT '站点实际揽收类型(揽收入仓取最早)',
   `actual_taking_scanuser` string COMMENT '站点实际揽收扫描员(揽收入仓取最早)',
   `taking_later_scantime` timestamp COMMENT '站点最晚揽收时间',
   `taking_early_scantime` timestamp COMMENT '站点最早揽收时间',
   `taking_early_weight` double COMMENT '运单在该站点揽收最早重量',
   `taking_early_scanuser` string COMMENT '运单在该站点揽收最早扫描员',
   `warehousing_later_scantime` timestamp COMMENT '站点最晚入仓时间',
   `warehousing_early_scantime` timestamp COMMENT '站点最早入仓时间',
   `warehousing_early_weight` double COMMENT '站点最早入仓重量',
   `warehousing_early_scanuser` string COMMENT '站点最早入仓扫描员',
   `bagging_early_scantime` timestamp COMMENT '站点最早建包时间',
   `bagging_later_scantime` timestamp COMMENT '站点最晚建包时间',
   `bagging_later_package_code` string COMMENT '站点最晚建包包号',
   `unloading_later_scantime` timestamp COMMENT '站点最晚卸车时间',
   `unloading_early_scantime` timestamp COMMENT '站点最早卸车时间',
   `unloading_early_weight` double COMMENT '站点最早卸车重量',
   `arrival_later_scantime` timestamp COMMENT '站点最晚到件时间',
   `arrival_early_scantime` timestamp COMMENT '站点最早到件时间',
   `arrival_early_weight` double COMMENT '站点最早到件重量',
   `arrival_early_scanuser` string COMMENT '站点最早到件扫描员',
   `unloading_arrival_shipment_no` string COMMENT '站点最早卸车到件任务号',
   `unloading_arrival_planned_departure_time` timestamp COMMENT '站点卸车到件规划发车时间',
   `unloading_arrival_planned_arrival_time` timestamp COMMENT '站点卸车到件规划到车时间',
   `unloading_arrival_actual_departure_time` timestamp COMMENT '站点卸车到件实际发车时间',
   `unloading_arrival_actual_arrival_time` timestamp COMMENT '站点卸车到件实际到车时间',
   `unloading_arrival_previous_network_code` string COMMENT '站点卸车到件上一站站点编码',
   `unloading_arrival_previous_network_type` int COMMENT '站点卸车到件上一站站点类型',
   `loading_early_scantime` timestamp COMMENT '站点最早装车扫描时间',
   `loading_later_scantime` timestamp COMMENT '站点最晚装车扫描时间',
   `loading_later_weight` double COMMENT '站点最晚装车重量',
   `send_early_scantime` timestamp COMMENT '站点最早发件扫描时间',
   `send_later_scantime` timestamp COMMENT '站点最晚发件扫描时间',
   `send_later_weight` double COMMENT '站点最晚发件重量',
   `send_later_scanuser` string COMMENT '站点最晚发件扫描员',
   `loading_send_shipment_no` string COMMENT '站点最晚装车发件任务号',
   `loading_send_planned_departure_time` timestamp COMMENT '站点装车发件规划发车时间',
   `loading_send_planned_arrival_time` timestamp COMMENT '站点装车发件规划到车时间',
   `loading_send_actual_departure_time` timestamp COMMENT '站点装车发件实际发车时间',
   `loading_send_actual_arrival_time` timestamp COMMENT '站点装车发件实际到车时间',
   `loading_send_next_network_code` string COMMENT '站点最晚装车发件下一站站点编码',
   `loading_send_next_network_type` int COMMENT '站点最晚装车发件下一站站点类型',
   `deliver_early_scantime` timestamp COMMENT '站点最早派件扫描时间',
   `deliver_later_scantime` timestamp COMMENT '站点最晚派件扫描时间',
   `deliver_later_weight` double COMMENT '站点最晚派件重量',
   `deliver_later_scanuser` string COMMENT '站点最晚派件扫描员',
   `actual_sign_scantime` timestamp COMMENT '站点实际签收时间(签收出库取最早)',
   `actual_sign_weight` double COMMENT '站点实际签收重量(签收出库取最早)',
   `actual_sign_scantype` string COMMENT '站点实际签收类型(签收出库取最早)',
   `actual_sign_scanuser` string COMMENT '站点实际签收扫描员(签收出库取最早)',
   `aging_sign_scantime` timestamp COMMENT '站点时效签收时间(签收,出库,入库,代理点收入取最早)',
   `aging_sign_weight` double COMMENT '站点时效签收重量(签收,出库,入库,代理点收入取最早)',
   `aging_sign_scantype` string COMMENT '站点时效签收类型(签收,出库,入库,代理点收入取最早)',
   `aging_sign_scanuser` string COMMENT '站点时效签收扫描员(签收,出库,入库,代理点收入取最早)')
 COMMENT '运单站点轨迹宽表，维度:运单+站点，分区字段：最晚扫描时间yyyy-MM-dd'
 PARTITIONED BY (
   `dt` string COMMENT '订单录入时间，yyyy-MM-dd格式，15天数据')
 ROW FORMAT SERDE
   'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
 STORED AS INPUTFORMAT
   'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
 OUTPUTFORMAT
   'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
 LOCATION
   '/dw/hive/jms_dwd.db/external/dwd_s02_whole_operations_trace_step_dt'
 TBLPROPERTIES (
   'discover.partitions'='true',
   'parquet.column.index.access'='true')